﻿package myapp;

import static org.junit.Assert.*;

import org.junit.Test;

public class ArithmeticTest {

	@Test
	public void testOper1() {//整数和分数的运算 
		assertEquals("17/3", Arithmetic.oper1('+', 5, 2, 3));
		assertEquals("36/7", Arithmetic.oper1('-', 6, 6, 7));
		assertEquals("15/8", Arithmetic.oper1('*', 5, 3, 8));
		assertEquals("24/5", Arithmetic.oper1('÷', 3, 5, 8));
	}

	@Test
	public void testOper2() {//整数和整数的运算 
		assertEquals("10", Arithmetic.oper2('+', 4, 6));
		assertEquals("6", Arithmetic.oper2('-', 12, 6));
		assertEquals("72", Arithmetic.oper2('*', 12, 6));
		assertEquals("23/6", Arithmetic.oper2('÷', 23, 6));
	}

	@Test
	public void testOper3() {//分数和分数的运算
		assertEquals("31/30", Arithmetic.oper3('+', 1, 5, 5, 6));
		assertEquals("6/35", Arithmetic.oper3('-', 3, 5, 3, 7));
		assertEquals("3/35", Arithmetic.oper3('*', 1, 5, 3, 7));
		assertEquals("6/25", Arithmetic.oper3('÷', 1, 5, 5, 6));
	}


}